# This is not really a server but i'm just creating this to show how the client
# and the server interact, in the future method calls performed by the client
# on the server will have to be done remotely via tcp/ip or something

from game.client.io.resource_manager import *
from game.object.world.dummy_world import *

class Server:
    def __init__(self):
        self.res_mgr = ResourceManager
        self.world = DummyWorld()


    def load_block(self, coord, coord_depth, lod , client):
        """
        See def on world load to see what the arguments to this method are
        """

        #This is a call back because that is how it will happen when the server
        #breaks from the client, the method will most likely change as we wont
        #directly access the client but a object that contains a socket to the
        #client

        #print "loading ", coord[coord_depth*3:coord_depth*3+3]

        cell = self.world.load_block(coord, coord_depth, lod)

        client.add_block(coord, coord_depth, cell)

